﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AuroraPlugin
{
    public partial class WSATTencent : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(Request["code"]) || Request["code"].Length != 15)
            {
                Response.Write("{\"ResultCode\":\"##resultcode##\"}".Replace("##resultcode##", "-1"));
                return;
            }
            var a = Database.db.Queryable<WSAT_Code>().AS("wsat_tencent").Where(i => i.code == Request["code"]);
            if (a.Count() <= 0)
            {
                Response.Write("{\"ResultCode\":\"##resultcode##\"}".Replace("##resultcode##", "0"));
                return;
            }
            Response.Write("{\"ResultCode\":\"##resultcode##\"}".Replace("##resultcode##", "1"));
        }
    }
}